package com.xjz.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xjz.model.entity.Post;
import com.xjz.model.entity.PostFavour;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xjz.model.entity.User;

/**
* @author 86135
* @description 针对表【post_favour(帖子收藏)】的数据库操作Service
* @createDate 2025-08-02 15:49:55
*/
public interface PostFavourService extends IService<PostFavour> {

    /**
     * 帖子收藏/取消收藏
     * @param postId
     * @param loginUser
     * @return
     */
    Integer doPostFavour(Long postId, User loginUser);

    /**
     * 收藏/取消收藏接口
     * @param userId
     * @param postId
     * @return
     */
    Integer doPostFavourInner(Long userId, Long postId);

    /**
     * 获取我收藏的帖子列表
     * @param objectPage
     * @param queryWrapper
     * @param userId
     * @return
     */
    Page<Post> listFavourPostByPage(Page<Post> objectPage,QueryWrapper<Post> queryWrapper, Long userId);
}
